package com.ruiysoft.service.wechat;

import com.ruiysoft.controller.wx.dto.OrderApplyRefundDto;
import com.ruiysoft.controller.wx.dto.OrderPayDto;
import com.ruiysoft.controller.wx.res.JsSignResponse;
import com.ruiysoft.controller.wx.res.TransferredResponse;
import com.ruiysoft.entity.sys.SysShopPayPlatform;
import com.ruiysoft.entity.sys.SysShopPersonnel;
import com.ruiysoft.entity.wechat.JsCodeSession;

import javax.validation.Valid;
import java.math.BigDecimal;

/**
 * Created by 化增光 on 2018/10/22.
 */
public interface IWeChatService {

    JsCodeSession login(String code, String appId);

//    JsCodeSession login(String code, Long shopId, String encryptedData, String iv);

    String getPrepayid(String appid, String paykey, String macid, String openid, @Valid OrderPayDto order);

    /**
     *  @param type
     * @param orderNo
     * @param refundNo
     * @param totalAmount
     * @param refundAmount
     */
    OrderApplyRefundDto refund(SysShopPayPlatform payPlatform, int type, String orderNo, String refundNo, BigDecimal totalAmount, BigDecimal refundAmount);

    String getAccessToken(String appId, String secret);

    byte[] wxacodeunlimit(String access_token, String s, String url);

    JsSignResponse jsSign(SysShopPersonnel personnel, SysShopPayPlatform sysShopPayPlatform, @Valid OrderPayDto order);

    TransferredResponse doTransfer(SysShopPayPlatform platform, String openid, String transactionNo, BigDecimal amount, String desc);

    //void sendWeChatTemplate(Long personnelId,String templateId,String pageUrl,)
}
